/*
 * @description: 修改密码
 * @Author: along
 * @Date: 2021-05-29
 * @Last Modified by: along
 * @Last Modified time: --
 */
<template>
    <div
        v-if="dialog"
        class="__model"
        @click="handleClose"
    >
        <div
            :style="{
                width: width + 'px'
            }"
            class="__wrap"
            @click.stop="stop"
        >
            <div class="__wrap_title">
                {{ title }}
            </div>
            <slot />
        </div>
    </div>
</template>

<script>
export default {
    props: {
        dialog: {
            type: Boolean,
            default: false
        },
        width: {
            type: Number,
            default: 520
        },
        title: {
            type: String,
            default: ''
        }
    },
    data() {
        return {
        };
    },
    mounted() {},
    methods: {
        handleClose (event) {
            event.stopPropagation();
            this.$emit('close');
        },
        stop (event) {
            event.stopPropagation();
        }
    },
};
</script>

<style lang="less" scoped>
.__model {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    background: rgba(0,0,0,.8);
    display: flex;
    justify-content: center;
    align-items: center;
    .__wrap {
        display: flex;
        flex-direction: column;
        align-items: center;
        background: #ffffff;
        border-radius: 4px;
        .__wrap_title {
            color: rgba(51, 51, 51, 1);
            font-size: 20px;
            font-weight: 500;
            height: 68px;
            width: 100%;
            line-height: 68px;
            box-sizing: border-box;
            padding-left: 32px;
            box-shadow: 0px 1px 0px 0px #E9E9E9;
            border-radius: 4px 4px 0 0;
            margin-bottom: 8px;
        }
    }
}
</style>